package com.icss.day03;

import com.icss.day03.a.C;

public class Test18 {
    public static final double PI = 3.1415;
    public static final Color RED = new Color(255, 0, 0);

    public static void main(String[] args) {
//        Test18.PI = 3.15;
//        RED = new Color();
        RED.g = 255;

        System.out.println(Color1.RED);
        // values()方法， 把枚举中的 常亮 组成 数组
        for (Color1 item:Color1.values()) {
            System.out.println(item);
        }
        // ordinal() 获取当前常亮的下标
        System.out.println(Color1.GREEN.ordinal());
    }
}
enum Color1 {
    // 必须在第一行， 构造方法变种
    RED(255, 0, 0), GREEN(0, 255, 0), BLUE(0, 255, 0);
    int r;
    int g;
    int b;
    Color1(int r, int g, int b) {
        this.r = r;
        this.g = g;
        this.b = b;
    }

}
class Color {
    public Color(int r, int g, int b) {
        this.r = r;
        this.g = g;
        this.b = b;
    }

    public Color() {
    }

    int r;
    int g;
    int b;
}
